home *** CD-ROM | disk | FTP | other *** search
/ Ultra Gameplayers 101 / Ultra Game Players Magazine, No. 101 - September 1997 (Imagine Publishing, Inc.)(1997).iso / pc / new_ugp.dxr / 00301_Visibility Hilite Class.ls < prev    next >
Encoding:
Text File  |  1997-07-10  |  1.4 KB  |  61 lines

  1. property showSpriteList, hideSpriteList, turnedOn, ancestor
  2.  
  3. on new me, parameterList
  4.   set showSpriteList to getaProp(parameterList, #showSpriteList)
  5.   set hideSpriteList to getaProp(parameterList, #hideSpriteList)
  6.   if not listp(showSpriteList) then
  7.     set showSpriteList to []
  8.   end if
  9.   if not listp(hideSpriteList) then
  10.     set hideSpriteList to []
  11.   end if
  12.   set turnedOn to 0
  13.   repeat with sNum in showSpriteList
  14.     set the visible of sprite sNum to 0
  15.     set mNum to the memberNum of sprite sNum
  16.     if mNum > 0 then
  17.       preloadMember(mNum)
  18.     end if
  19.   end repeat
  20.   return me
  21. end
  22.  
  23. on TurnOn me
  24.   repeat with sNum in showSpriteList
  25.     set the visible of sprite sNum to 1
  26.   end repeat
  27.   repeat with sNum in hideSpriteList
  28.     set the visible of sprite sNum to 0
  29.   end repeat
  30.   updateStage()
  31.   set turnedOn to 1
  32. end
  33.  
  34. on TurnOff me
  35.   if turnedOn then
  36.     repeat with sNum in showSpriteList
  37.       set the visible of sprite sNum to 0
  38.     end repeat
  39.     repeat with sNum in hideSpriteList
  40.       set the visible of sprite sNum to 1
  41.     end repeat
  42.     set turnedOn to 0
  43.   end if
  44. end
  45.  
  46. on dispose me
  47.   repeat with sNum in showSpriteList
  48.     set the visible of sprite sNum to 1
  49.   end repeat
  50.   repeat with sNum in hideSpriteList
  51.     set the visible of sprite sNum to 1
  52.   end repeat
  53.   set showSpriteList to []
  54.   set hideSpriteList to []
  55.   set turnedOn to 0
  56.   if objectp(ancestor) then
  57.     dispose(ancestor)
  58.   end if
  59.   set ancestor to 0
  60. end
  61.